package com.apple1.blogweb;

import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.sql.DataSource;

@SpringBootApplication(scanBasePackages = {"com.apple1"})
@MapperScan(basePackages={"com.apple1.blogdao"})
@EnableTransactionManagement
public class BlogWebApplication {
	@Bean
	@ConfigurationProperties("spring.datasource.druid")
	public DataSource druidDataSource(){
		return DruidDataSourceBuilder.create().build();
	}

	public static void main(String[] args) {
		SpringApplication.run(BlogWebApplication.class, args);
	}

}

